/*  
  -- The Lime II Project -- 

  A tuplespaces-based middleware for coordinating agents and mobile hosts.
  Copyright (C) 2005.
  Gian Pietro Picco, Amy L. Murphy, Lorenzo Bellini.

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  Lesser General Public License for more details.

  You should have received this copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
*/

package lime2;

/**
 * An operation modelling the triggering of a weak reaction. When a local weak reaction fires an instance of WeakOp 
 * is posted to the events queue of the LocalOpMgr by the corresponding system listener of the weak reaction. 
 * The system listener belongs to a (strong) system reaction registered within the local reactor.
 * 
 * @author Gian Pietro Picco
 * @author Amy Murphy
 * @author Lorenzo Bellini
 */

class WeakOp extends LocalOp 
{
 /**
  * Provides identification for the weak reaction.
  */	
 ReactionID wrid;  
 
 /**
  * Stores the event that triggered the weak reaction.
  */
 ReactionEvent wevent;
 
 /**
  * Constructor method.
  * 
  * @param wrid the id of the triggered weak reaction
  * @param wevent the event that triggered the weak reaction
  */
 WeakOp(ReactionID wrid, ReactionEvent wevent)
 {	
  // there is no need to return or synchronize on a result 
  super(LimeConstants.EVENTW, null);
  this.wrid = wrid;
  this.wevent = wevent;
 }
 
 /**
  * toString method.
  * 
  * @return textual representation 
  */ 
 public String toString() 
 {
  return "WeakOp (" + Translator.translateType(type) + ")";	
 }
 
}